package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author stone
 * @date 2022/04/29 10:26
 */
@Controller
public class HelloController {

    @RequestMapping("hello")
    @ResponseBody
    public String hello() {
        return "hello springmvc";
    }

    @RequestMapping("goodbye")
    @ResponseBody
    public String goodbye() {
        return "goodbye";
    }
    //localhost:8080/home -->  zhuye
    //localhost:8080/index -->  zhuye
    //localhost:8080/home/index -->  zhuye
    @RequestMapping({"home","index","home/index"})
    @ResponseBody
    public String index() {
        return "zhuye";
    }

    //http://localhost:8080/play
    //http://localhost:8080/play/tennis
    //http://localhost:8080/play/basketball
    //http://localhost:8080/playbasketball
    @ResponseBody
    @RequestMapping({"play*","play/*"})
    public String play() {
        return "play";
    }


}
